<template>
	<uni-nav-bar title="工作" color="#333" :border="false" statusBar></uni-nav-bar>
	<view class="center lis">
		<view class="column" v-for="item in list" :key="item.name" @click="jump(item.name,item.push)">
			<image :src="item.icon" mode="" style="width: 60rpx;height: 60rpx;margin-bottom: 10rpx;"></image>
			<text>{{item.name}}</text>
		</view>
	</view>
	<view v-if="show"><web-view :src="mapURI"></web-view></view>
	<SaleButtom active="2"></SaleButtom>
</template>

<script setup lang="ts">
	import { ref } from 'vue';
	import { navTo } from '@/utils/navigator';
	import SaleButtom from '@c/pobulic/saleButtom.vue';
	import {
		icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, icon9, icon10, icon11, icon12, icon13, icon14, icon15, icon16,
		icon17, icon18, icon19,icon20,icon21,icon22,icon23
	} from '@/utils/Statics';
	import { useUserInformation } from '@/stores/earthPushing/userSale';
	const userInfo = useUserInformation();
	userInfo.getUserInfo();
	const mapURI = ref('')
	const show = ref(false)
	const list = [{ name: '订单中心', push: 'Sale/order/order', icon: icon1 },
	{ name: '客户档案', push: 'Sale/index/customer', icon: icon2 },
	{ name: '车辆档案', push: 'Sale/carfriend/carList', icon: icon3 },
	{ name: '配送员补液', push: 'Sale/rehydrator/terminal', icon: icon4 },
	{ name: '操作手册', push: '', icon: icon5 },
	{ name: '二维码', push: 'Sale/Information/invite', icon: icon6 },
	{ name: '车友团', push: 'Sale/Information/teamList', icon: icon7 },
	{ name: '我的客户', push: 'Sale/Information/custom', icon: icon8 },
	{ name: '福利发放', push: 'Sale/Information/writeOff', icon: icon9 },
	{ name: '派单', push: 'Sale/order/receOrder', icon: icon10 },
	{ name: '车友呼叫', push: 'Sale/callBack/callList', icon: icon11 },
	{ name: '外卖加注', push: 'Sale/takeaway/order', icon: icon12 },
	{ name: '合伙人', push: 'Sale/partner/partnerList', icon: icon13 },
	{ name: '考勤', push: 'Sale/attendance/attendance', icon: icon14 },
	{ name: '月度薪资', push: 'Sale/salary/salaryList', icon: icon15 },
	{ name: '仓库', push: 'Sale/warehouse/houseList', icon: icon16 },
	{ name: '报销单据', push: 'Sale/reimbursement/addReimbursement', icon: icon17 },
	{ name: '福利商城', push: 'Sale/warehouse/shopList', icon: icon18 },
	{ name: '盘库', push: 'Sale/inventory/inventoryList', icon: icon19 },
	{ name: '加团客户', push: 'Sale/carfriend/teamCar', icon: icon22 },
	{ name: '保障客户', push: 'Sale/carfriend/assureCar', icon: icon23 },
	{ name: '班次', push: 'Sale/checkWork/working', icon: icon20 },
	{ name: '历史班次', push: 'Sale/checkWork/historyWork', icon: icon21 },
	{ name: '配送费膨胀', push: 'Sale/delivery/deliveryList', icon: icon1 },
	]
	function jump(name : string, push : string) {
		const banId = userInfo && userInfo.userInfor ? userInfo.userInfor.ban_id : ''
		if (name === '班次' && banId != 0) {
			navTo('Sale/checkWork/working?banId=' + banId)
		} else if (name === '班次' && banId == 0) {
			navTo('Sale/checkWork/checkWork')
		} else {
			navTo(push)
		}
	}
</script>

<style scoped lang="less">
	.lis {
		flex-wrap: wrap;
		padding: 0px 20rpx;
		box-sizing: border-box;

		view {
			width: 23%;
			margin-right: 2.5%;
			background-color: #fff;
			text-align: center;
			padding: 30rpx 0px;
			box-sizing: border-box;
			margin-top: 20rpx;
			border-radius: 5px;

			text {
				font-size: 26rpx;
			}
		}

		view:nth-child(4n) {
			margin-right: 0rpx;
		}
	}
</style>